﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="备品备件库存.aspx.cs" Inherits="syc.Jidong.备品备件库存" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
    <form id="form1" runat="server">
            <div align="center" id="report1">    
                <h1 style="text-align: center;">分厂库存</h1>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="生产线" HeaderText="生产线" SortExpression="生产线" />
            <asp:BoundField DataField="品名" HeaderText="品名" SortExpression="品名" ItemStyle-Width="100" ItemStyle-Height="40"/>
            <asp:BoundField DataField="数量" HeaderText="数量" SortExpression="数量" ItemStyle-Width="100" ItemStyle-Height="40"/>
        </Columns>
        <HeaderStyle Height="40px" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
        SelectCommand="
SELECT 
case 
when [备品备件收支表].生产线=1 then '一分厂'
when [备品备件收支表].生产线=2 then '二分厂'
when [备品备件收支表].生产线=3 then '三分厂'
when [备品备件收支表].生产线=4 then '四分厂'
when [备品备件收支表].生产线=5 then '五分厂'
end AS 生产线,[备品备件收支表].品名,SUM([备品备件收支表].数量) AS 数量
FROM [备品备件收支表]
GROUP BY [备品备件收支表].生产线,[备品备件收支表].品名">
    </asp:SqlDataSource>
    
            </div>
            
                        <div align="center" id="report2">    
                <h1 style="text-align: center;">总体库存</h1>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource2">
        <Columns>
            <asp:BoundField DataField="品名" HeaderText="品名" SortExpression="品名" ItemStyle-Width="100" ItemStyle-Height="40" />
            <asp:BoundField DataField="数量" HeaderText="数量" SortExpression="数量" ItemStyle-Width="100" ItemStyle-Height="40"/>
        </Columns>
        <HeaderStyle Height="40px" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
        SelectCommand="
SELECT [备品备件收支表].品名,SUM([备品备件收支表].数量) AS 数量
FROM [备品备件收支表]
GROUP BY [备品备件收支表].品名">
    </asp:SqlDataSource>
    
            </div>
    </form>
</body>
</html>
